<html>
<head><meta charset="utf-8"><title>pretty-printed aggregates in types (and maybe Rust (v0) m... · t-compiler/const-eval · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/index.html">t-compiler/const-eval</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html">pretty-printed aggregates in types (and maybe Rust (v0) m...</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="193123408"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193123408" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193123408">(Apr 07 2020 at 01:40)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> hang on, we have <code>destructure_const</code>, and it's a query, right?</p>



<a name="193123428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193123428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193123428">(Apr 07 2020 at 01:41)</a>:</h4>
<ol>
<li>isn't <code>const_field</code> obsolete then?</li>
<li>do we really need anything else to be able to mangle non-trivial consts?</li>
</ol>



<a name="193123436"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193123436" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193123436">(Apr 07 2020 at 01:41)</a>:</h4>
<p>there should be something that turns <code>&amp;T</code> into <code>T</code> I guess</p>



<a name="193143633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193143633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193143633">(Apr 07 2020 at 05:56)</a>:</h4>
<p>We're really running in circles</p>



<a name="193143636"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193143636" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193143636">(Apr 07 2020 at 05:56)</a>:</h4>
<p>you have reached my starting point</p>



<a name="193143645"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193143645" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193143645">(Apr 07 2020 at 05:56)</a>:</h4>
<p>The reason I started this discussion is because of our broken match code</p>



<a name="193143655"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193143655" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193143655">(Apr 07 2020 at 05:57)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/pull/70743" title="https://github.com/rust-lang/rust/pull/70743">https://github.com/rust-lang/rust/pull/70743</a></p>



<a name="193162336"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193162336" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193162336">(Apr 07 2020 at 09:47)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> replying to the wrong topic?</p>



<a name="193162405"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193162405" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193162405">(Apr 07 2020 at 09:48)</a>:</h4>
<p>this is about that thing I told you that we could make v0 value mangling work for tuples, structs and arrays by abusing <code>const_field</code></p>



<a name="193163057"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193163057" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193163057">(Apr 07 2020 at 09:54)</a>:</h4>
<p>const field is there for <code>simd_shuffle</code></p>



<a name="193163071"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193163071" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193163071">(Apr 07 2020 at 09:54)</a>:</h4>
<p>but we may be albe to eliminate it at some point</p>



<a name="193163123"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193163123" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193163123">(Apr 07 2020 at 09:55)</a>:</h4>
<p>I implemented <code>const_deref</code>, but I'm unsure how to handle wide pointers</p>



<a name="193163213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193163213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193163213">(Apr 07 2020 at 09:56)</a>:</h4>
<p>right... destructure_const should do the trick for <code>v0</code></p>



<a name="193163262"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193163262" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193163262">(Apr 07 2020 at 09:56)</a>:</h4>
<p>but is <code>const_field</code> <em>needed</em> if you can just call <code>destructure_const</code>?</p>



<a name="193163269"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193163269" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193163269">(Apr 07 2020 at 09:56)</a>:</h4>
<p>for <code>simd_shuffle</code> I mean</p>



<a name="193163337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193163337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193163337">(Apr 07 2020 at 09:57)</a>:</h4>
<p>ah</p>



<a name="193163349"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193163349" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193163349">(Apr 07 2020 at 09:58)</a>:</h4>
<p>well... it's a bit more expensive, but that's probably irrelevant</p>



<a name="193163408"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193163408" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193163408">(Apr 07 2020 at 09:58)</a>:</h4>
<p>wouldn't <code>const_field</code> be more expensive?</p>



<a name="193163419"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193163419" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193163419">(Apr 07 2020 at 09:58)</a>:</h4>
<p>given that it's called for every element of the array?</p>



<a name="193163436"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193163436" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193163436">(Apr 07 2020 at 09:58)</a>:</h4>
<p>since what <code>simd_shuffle</code> wants is to get the whole array, no?</p>



<a name="193163457"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193163457" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193163457">(Apr 07 2020 at 09:58)</a>:</h4>
<p>I thought it would just extract a single thing, but I probably misremember</p>



<a name="193163524"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193163524" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193163524">(Apr 07 2020 at 09:59)</a>:</h4>
<p>also <code>Vec&lt;ty::Const&gt;</code> should probably be <code>&amp;[ty::Const]</code> just to make the query even cheaper :P</p>



<a name="193183145"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193183145" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193183145">(Apr 07 2020 at 13:00)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> oh wait even before mangling... we can pretty-print ADTs :D</p>



<a name="193183220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193183220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193183220">(Apr 07 2020 at 13:01)</a>:</h4>
<p>brought to you by reading:</p>
<div class="codehilite"><pre><span></span><span class="n">_3</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="p">{</span><span class="n">transmute</span><span class="p">(</span><span class="mh">0x01</span><span class="p">)</span>: <span class="nc">std</span>::<span class="n">option</span>::<span class="nb">Option</span><span class="o">&lt;</span><span class="kt">bool</span><span class="o">&gt;</span><span class="p">};</span><span class="w"></span>
</pre></div>



<a name="193183301"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193183301" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193183301">(Apr 07 2020 at 13:01)</a>:</h4>
<p><code>destructure_const</code> + <code>ty::Adt</code> has all the info we need</p>



<a name="193183368"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193183368" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193183368">(Apr 07 2020 at 13:02)</a>:</h4>
<p>/me gets tempted to try and do this <em>now</em></p>



<a name="193183480"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193183480" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193183480">(Apr 07 2020 at 13:03)</a>:</h4>
<p>heh</p>



<a name="193184386"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193184386" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193184386">(Apr 07 2020 at 13:09)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/146212-t-compiler.2Fconst-eval/topic/values.20in.20Rust.20(v0).20mangling/near/193163524" title="#narrow/stream/146212-t-compiler.2Fconst-eval/topic/values.20in.20Rust.20(v0).20mangling/near/193163524">said</a>:</p>
<blockquote>
<p>also <code>Vec&lt;ty::Const&gt;</code> should probably be <code>&amp;[ty::Const]</code> just to make the query even cheaper :P</p>
</blockquote>
<p>idk why I imagined <code>Vec</code>, it's <code>pub fields: &amp;'tcx [&amp;'tcx ty::Const&lt;'tcx&gt;]</code> already</p>



<a name="193435934"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193435934" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193435934">(Apr 09 2020 at 11:14)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> 5min test logic: :D</p>
<div class="codehilite"><pre><span></span><span class="gd">-       -         _11 = const {transmute(0x28): Temp}; // bb1[4]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:12: 16:28</span>
<span class="gi">+       -         _11 = const Temp#0{40u8,};       // bb1[4]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:12: 16:28</span>
</pre></div>



<a name="193436023"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193436023" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193436023">(Apr 09 2020 at 11:15)</a>:</h4>
<p>the next step is to make it pretty :P</p>



<a name="193436025"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193436025" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193436025">(Apr 09 2020 at 11:15)</a>:</h4>
<p>but the fields work</p>



<a name="193436136"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193436136" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193436136">(Apr 09 2020 at 11:16)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="gd">-       -         _1 = const {transmute(()): ((), ())}; // bb0[5]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:20: 13:28</span>
<span class="gi">+       -         _1 = const ((), ())#0{()#0{},()#0{},}; // bb0[5]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:20: 13:28</span>
</pre></div>



<a name="193436188"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193436188" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193436188">(Apr 09 2020 at 11:17)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="gd">-       +         ((*_4).0: alloc::raw_vec::RawVec&lt;u32&gt;) = const ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [65535], len: Size { raw: 16 } }, size: Size { raw: 16 }, align: Align { pow2: 3 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }: alloc::raw_vec::RawVec::&lt;u32&gt;; // bb0[4]: scope 2 at $SRC_DIR/liballoc/vec.rs:LL:COL</span>
<span class="gi">+       +         ((*_4).0: alloc::raw_vec::RawVec&lt;u32&gt;) = const alloc::raw_vec::RawVec::&lt;u32&gt;#0{std::ptr::Unique::&lt;u32&gt;#0{{0x4 as *const u32},std::marker::PhantomData::&lt;u32&gt;#0{},},0usize,std::alloc::Global#0{},}; // bb0[4]: scope 2 at $SRC_DIR/liballoc/vec.rs:LL:COL</span>
</pre></div>



<a name="193436196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193436196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193436196">(Apr 09 2020 at 11:17)</a>:</h4>
<p>oooh fascinating</p>



<a name="193436313"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193436313" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193436313">(Apr 09 2020 at 11:19)</a>:</h4>
<p>I wonder how many <code>alloc</code> dumps I can get rid of, <em>without</em> implementing anything for references</p>



<a name="193436322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193436322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193436322">(Apr 09 2020 at 11:19)</a>:</h4>
<p>whoa</p>



<a name="193436359"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193436359" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193436359">(Apr 09 2020 at 11:19)</a>:</h4>
<p>well... for references you can just steal the <code>deref_const</code> query from my other PR</p>



<a name="193436363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193436363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193436363">(Apr 09 2020 at 11:19)</a>:</h4>
<p>so that raw pointers and references still use <code>alloc</code></p>



<a name="193436372"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193436372" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193436372">(Apr 09 2020 at 11:19)</a>:</h4>
<p>(at least in MIR dumps)</p>



<a name="193436413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193436413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193436413">(Apr 09 2020 at 11:20)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="gd">-       +         _3 = const {transmute(0x01): std::option::Option&lt;bool&gt;}; // bb0[3]: scope 0 at $DIR/discriminant.rs:6:34: 6:44</span>
<span class="gi">+       +         _3 = const std::option::Option::&lt;bool&gt;#1{true,}; // bb0[3]: scope 0 at $DIR/discriminant.rs:6:34: 6:44</span>
</pre></div>



<a name="193436430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193436430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193436430">(Apr 09 2020 at 11:20)</a>:</h4>
<p>found the motivating example :P</p>



<a name="193436438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193436438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193436438">(Apr 09 2020 at 11:20)</a>:</h4>
<p>the <code>#1</code>s are the variant id?</p>



<a name="193436443"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193436443" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193436443">(Apr 09 2020 at 11:20)</a>:</h4>
<p>yeah</p>



<a name="193436480"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193436480" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193436480">(Apr 09 2020 at 11:20)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="w">                </span><span class="kd">let</span><span class="w"> </span><span class="n">contents</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="bp">self</span><span class="p">.</span><span class="n">tcx</span><span class="p">().</span><span class="n">destructure_const</span><span class="p">(</span><span class="w"></span>
<span class="w">                    </span><span class="n">ty</span>::<span class="n">ParamEnv</span>::<span class="n">reveal_all</span><span class="p">()</span><span class="w"></span>
<span class="w">                        </span><span class="p">.</span><span class="n">and</span><span class="p">(</span><span class="bp">self</span><span class="p">.</span><span class="n">tcx</span><span class="p">().</span><span class="n">mk_const</span><span class="p">(</span><span class="n">ty</span>::<span class="n">Const</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">val</span>: <span class="nc">ty</span>::<span class="n">ConstKind</span>::<span class="n">Value</span><span class="p">(</span><span class="n">ct</span><span class="p">),</span><span class="w"> </span><span class="n">ty</span><span class="w"> </span><span class="p">})),</span><span class="w"></span>
<span class="w">                </span><span class="p">);</span><span class="w"></span>

<span class="w">                </span><span class="n">p</span><span class="o">!</span><span class="p">(</span><span class="n">print</span><span class="p">(</span><span class="n">ty</span><span class="p">),</span><span class="w"> </span><span class="n">write</span><span class="p">(</span><span class="s">&quot;#{:?}{{&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">contents</span><span class="p">.</span><span class="n">variant</span><span class="p">));</span><span class="w"></span>
<span class="w">                </span><span class="k">for</span><span class="w"> </span><span class="o">&amp;</span><span class="n">field</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="n">contents</span><span class="p">.</span><span class="n">fields</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">                    </span><span class="n">p</span><span class="o">!</span><span class="p">(</span><span class="n">print</span><span class="p">(</span><span class="n">field</span><span class="p">),</span><span class="w"> </span><span class="n">write</span><span class="p">(</span><span class="s">&quot;,&quot;</span><span class="p">));</span><span class="w"></span>
<span class="w">                </span><span class="p">}</span><span class="w"></span>
<span class="w">                </span><span class="n">p</span><span class="o">!</span><span class="p">(</span><span class="n">write</span><span class="p">(</span><span class="s">&quot;}}&quot;</span><span class="p">));</span><span class="w"></span>
</pre></div>



<a name="193436486"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193436486" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193436486">(Apr 09 2020 at 11:20)</a>:</h4>
<p>that's literally it</p>



<a name="193436523"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/193436523" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#193436523">(Apr 09 2020 at 11:21)</a>:</h4>
<p>(I have a check that there's no type/const parameters, to make sure the empty param env is correct)</p>



<a name="194383435"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/194383435" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#194383435">(Apr 17 2020 at 00:16)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> came back to this, spent a few minutes on it and got:</p>
<div class="codehilite"><pre><span></span><span class="gd">-       +         ((*_4).0: alloc::raw_vec::RawVec&lt;u32&gt;) = const ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [65535], len: Size { raw: 16 } }, size: Size { raw: 16 }, align: Align { pow2: 3 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }: alloc::raw_vec::RawVec::&lt;u32&gt;; // bb0[4]: scope 2 at $SRC_DIR/liballoc/vec.rs:LL:COL</span>
<span class="gi">+       +         ((*_4).0: alloc::raw_vec::RawVec&lt;u32&gt;) = const alloc::raw_vec::RawVec::&lt;u32&gt; { ptr: std::ptr::Unique::&lt;u32&gt; { pointer: {0x4 as *const u32}, _marker: std::marker::PhantomData::&lt;u32&gt; }, cap: 0usize, alloc: std::alloc::Global }; // bb0[4]: scope 2 at $SRC_DIR/liballoc/vec.rs:LL:COL</span>
</pre></div>



<a name="194383531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/194383531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#194383531">(Apr 17 2020 at 00:18)</a>:</h4>
<p>that RHS on the second line is:<br>
<code>alloc::raw_vec::RawVec::&lt;u32&gt; { ptr: std::ptr::Unique::&lt;u32&gt; { pointer: {0x4 as *const u32}, _marker: std::marker::PhantomData::&lt;u32&gt; }, cap: 0usize, alloc: std::alloc::Global }</code></p>



<a name="194391625"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/194391625" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#194391625">(Apr 17 2020 at 03:00)</a>:</h4>
<p>aand we have a PR :D <a href="https://github.com/rust-lang/rust/pull/71232" title="https://github.com/rust-lang/rust/pull/71232">https://github.com/rust-lang/rust/pull/71232</a></p>



<a name="194460301"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/194460301" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#194460301">(Apr 17 2020 at 15:45)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> thanks :D</p>



<a name="194460856"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/194460856" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#194460856">(Apr 17 2020 at 15:49)</a>:</h4>
<p>^^ that PR was so much less complex than I had anticipated</p>



<a name="194460880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/194460880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#194460880">(Apr 17 2020 at 15:49)</a>:</h4>
<p>told ya :P</p>



<a name="194460919"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/194460919" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#194460919">(Apr 17 2020 at 15:49)</a>:</h4>
<p>the moment I saw <code>destructure_const</code> I was like "hang on the hard part will be making it pretty"</p>



<a name="194461109"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/194461109" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#194461109">(Apr 17 2020 at 15:50)</a>:</h4>
<p>but also I think there's a bug in std, <code>fmt.debug_tuple("").finish()</code> prints nothing instead of <code>()</code></p>



<a name="194461130"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/194461130" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#194461130">(Apr 17 2020 at 15:51)</a>:</h4>
<p>eh who cares</p>



<a name="194461210"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/194461210" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#194461210">(Apr 17 2020 at 15:51)</a>:</h4>
<p>(the trailing comma behavior does depend on whether the name is an empty string, so there's that :P)</p>



<a name="194461234"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/194461234" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#194461234">(Apr 17 2020 at 15:51)</a>:</h4>
<p>lolwat</p>



<a name="194461316"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/pretty-printed%20aggregates%20in%20types%20%28and%20maybe%20Rust%20%28v0%29%20m.../near/194461316" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/pretty-printed.20aggregates.20in.20types.20(and.20maybe.20Rust.20(v0).20m.2E.2E.2E.html#194461316">(Apr 17 2020 at 15:52)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> <code>debug_tuple</code> theoretically handles both tuples and tuple structs/variants</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>